home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Resources / Utilities / Partition Logic 0.68 / partlogic-0.68.iso / system / headers / sys / file.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-10  |  1.9 KB  |  67 lines

  1. // 
  2. //  Visopsys
  3. //  Copyright (C) 1998-2007 J. Andrew McLaughlin
  4. //  
  5. //  This library is free software; you can redistribute it and/or modify it
  6. //  under the terms of the GNU Lesser General Public License as published by
  7. //  the Free Software Foundation; either version 2.1 of the License, or (at
  8. //  your option) any later version.
  9. //
  10. //  This library is distributed in the hope that it will be useful, but
  11. //  WITHOUT ANY WARRANTY; without even the implied warranty of
  12. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser
  13. //  General Public License for more details.
  14. //
  15. //  You should have received a copy of the GNU Lesser General Public License
  16. //  along with this library; if not, write to the Free Software Foundation,
  17. //  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. //
  19. //  file.h
  20. //
  21.  
  22. // This file contains definitions and structures for using and manipulating
  23. // files in Visopsys.
  24.  
  25. #if !defined(_FILE_H)
  26.  
  27. // File open modes
  28. #define OPENMODE_READ        0x01
  29. #define OPENMODE_WRITE       0x02
  30. #define OPENMODE_CREATE      0x04
  31. #define OPENMODE_TRUNCATE    0x08
  32. #define OPENMODE_READWRITE   (OPENMODE_READ | OPENMODE_WRITE)
  33.  
  34. // Pathname limits
  35. #define MAX_NAME_LENGTH      512
  36. #define MAX_PATH_LENGTH      512
  37. #define MAX_PATH_NAME_LENGTH (MAX_PATH_LENGTH + MAX_NAME_LENGTH)
  38.  
  39. // Typedef a file handle
  40. typedef void* fileHandle;
  41.  
  42. typedef enum {
  43.   fileT, dirT, linkT, volT, unknownT
  44. } fileType;
  45.  
  46. // This is the structure used to store universal information about a file
  47. typedef struct {
  48.   fileHandle handle;
  49.   char name[MAX_NAME_LENGTH];
  50.   fileType type;
  51.   char filesystem[MAX_PATH_LENGTH];
  52.   unsigned creationDate;
  53.   unsigned creationTime;
  54.   unsigned accessedTime;
  55.   unsigned accessedDate;
  56.   unsigned modifiedDate;
  57.   unsigned modifiedTime;
  58.   unsigned size;
  59.   unsigned blocks;
  60.   unsigned blockSize;
  61.   int openMode;
  62.  
  63. } file;
  64.  
  65. #define _FILE_H
  66. #endif
  67.